<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>绒法课堂</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.3/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.7.2/css/all.min.css" rel="stylesheet">
    <style>
        :root {
            --primary-color: #3498db;
            --light-color: #ecf0f1;
            --danger-color: #e74c3c;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: #f9f9f9;
            color: #333;
        }
        a:hover {
            cursor: pointer;
        }
        .header {
            background: linear-gradient(135deg, #4265ed, #4209ed);
            color: white;
            padding: 15px 0;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            text-align: center;
        }

        .logo {
            font-weight: 700;
            font-size: 24px;
        }

        .scrollable-tabs-container {
            overflow-x: auto;
            overflow-y: hidden;
            white-space: nowrap;
            -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
            scrollbar-width: none; /* Firefox隐藏滚动条 */
            padding-bottom: 5px; /* 给滚动条留空间 */
        }

        /* 隐藏滚动条 */
        .scrollable-tabs-container::-webkit-scrollbar {
            display: none;
        }

        .nav-tabs {
            border-bottom: 2px solid #dee2e6;
            margin-bottom: 20px;
        }

        .nav-tabs .nav-link {
            border: none;
            color: #555;
            font-weight: 600;
            padding: 12px 10px;
            margin-right: 5px;
            border-radius: 5px 5px 0 0;
        }

        .nav-tabs .nav-link:hover {
            border: none;
            background-color: #f1f1f1;
        }

        .nav-tabs .nav-link.active {
            color: var(--primary-color);
            background-color: white;
            border-bottom: 3px solid var(--primary-color);
        }

        .news-card {
            background: white;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            margin-bottom: 20px;
            transition: transform 0.3s, box-shadow 0.3s;
        }

        .news-card img {
            user-select: none;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            pointer-events: none;
        }

        .news-card:hover {
            cursor: pointer;
            transform: translateY(-5px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }

        .news-img {
            height: 180px;
            object-fit: cover;
            width: 100%;
        }

        .news-body {
            padding: 15px;
        }

        .news-title {
            font-weight: 600;
            margin-bottom: 10px;
            color: #2c3e50;
        }

        .news-title a {
            color: inherit;
            text-decoration: none;
        }

        .news-title a:hover {
            color: var(--primary-color);
        }

        .news-meta {
            font-size: 13px;
            color: #777;
            margin-bottom: 10px;
        }

        .news-meta span {
            margin-right: 15px;
        }

        .news-meta i {
            margin-right: 5px;
            color: var(--primary-color);
        }

        .news-desc {
            color: #555;
            font-size: 14px;
            line-height: 1.6;
            margin-bottom: 10px;
        }

        .news-tag {
            display: inline-block;
            background: #f1f1f1;
            color: #666;
            padding: 3px 8px;
            border-radius: 3px;
            font-size: 12px;
            margin-right: 5px;
        }

        .footer {
            background: #4265ed;
            color: white;
            padding-top: 30px;
            padding-bottom: 10px;
            margin-top: 20px;
        }

        .copyright {
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            padding-top: 20px;
            margin-top: 20px;
            font-size: 14px;
            color: rgba(255, 255, 255, 0.7);
        }

        @media (max-width: 768px) {
            .news-img {
                height: 150px;
            }
        }
    </style>
</head>
<body oncontextmenu="return false;">
<!-- 顶部导航栏 -->
<header class="header">
    <div class="container">
        <div class="logo">“绒”法课堂</div>
    </div>
</header>

<!-- 主要内容区 -->
<main class="container my-2">
    <!-- 新闻分类标签 -->
    <div class="scrollable-tabs-container">
        <ul class="nav nav-tabs" id="newsTab" role="tablist">
            <li class="nav-item" role="presentation">
                <button class="nav-link active" id="all-tab" data-bs-toggle="tab" data-bs-target="#all" type="button" role="tab">全部</button>
            </li>
            <li class="nav-item" role="presentation">
                <button class="nav-link" id="classic-tab" data-bs-toggle="tab" data-bs-target="#classic" type="button" role="tab">典型案例</button>
            </li>
            <li class="nav-item" role="presentation">
                <button class="nav-link" id="law-tab" data-bs-toggle="tab" data-bs-target="#law" type="button" role="tab">法律速递</button>
            </li>
            <li class="nav-item" role="presentation">
                <button class="nav-link" id="guide-tab" data-bs-toggle="tab" data-bs-target="#guide" type="button" role="tab">维权指引</button>
            </li>
        </ul>
    </div>
    <!-- 新闻列表 -->
    <div class="tab-content" id="newsTabContent">
        <div class="tab-pane fade show active" id="all" role="tabpanel">
            <div class="row">
                @foreach($collection as $item)
                    <div class="col-md-6 col-lg-4">
                        <a href="https://erp.toysmodel.cn:11443/detail/{{$item->id}}">
                            <div class="news-card">
                                <img src="{{ $item->covers ?: $default }}" class="news-img" alt="图片">
                                <div class="news-body">
                                    <h5 class="news-title"><a href="https://erp.toysmodel.cn:11443/detail/{{$item->id}}">{{ $item->title }}</a></h5>
                                    <div class="news-meta">
                                        <span><i class="far fa-calendar-alt"></i>{{$item->datetime}}</span>
                                        <span><i class="far fa-eye"></i>{{ $item->views }}</span>
                                    </div>
                                    <p class="news-desc">{{$item->subtitle}}...</p>
                                    <div>
                                        <span class="news-tag">{{$categories[$item->cate_id]}}</span>
                                    </div>
                                </div>
                            </div>
                        </a>
                    </div>
                @endforeach
            </div>
        </div>

        <div class="tab-pane fade" id="classic" role="tabpanel">
            <div class="row">
                @foreach($collection->where('cate_id', 9) as $item)
                    <div class="col-md-6 col-lg-4">
                        <a href="https://erp.toysmodel.cn:11443/detail/{{$item->id}}">
                            <div class="news-card">
                                <img src="{{ $item->covers ?: $default }}" class="news-img" alt="图片">
                                <div class="news-body">
                                    <h5 class="news-title"><a href="https://erp.toysmodel.cn:11443/detail/{{$item->id}}">{{ $item->title }}</a></h5>
                                    <div class="news-meta">
                                        <span><i class="far fa-calendar-alt"></i>{{$item->datetime}}</span>
                                        <span><i class="far fa-eye"></i>{{ $item->views }}</span>
                                    </div>
                                    <p class="news-desc">{{$item->subtitle}}...</p>
                                    <div>
                                        <span class="news-tag">{{$categories[$item->cate_id]}}</span>
                                    </div>
                                </div>
                            </div>
                        </a>
                    </div>
                @endforeach
            </div>
        </div>

        <div class="tab-pane fade" id="law" role="tabpanel">
            <div class="row">
                @foreach($collection->where('cate_id', 10) as $item)
                    <div class="col-md-6 col-lg-4">
                        <a href="https://erp.toysmodel.cn:11443/detail/{{$item->id}}">
                            <div class="news-card">
                                <img src="{{ $item->covers ?: $default }}" class="news-img" alt="图片">
                                <div class="news-body">
                                    <h5 class="news-title"><a href="https://erp.toysmodel.cn:11443/detail/{{$item->id}}">{{ $item->title }}</a></h5>
                                    <div class="news-meta">
                                        <span><i class="far fa-calendar-alt"></i>{{$item->datetime}}</span>
                                        <span><i class="far fa-eye"></i>{{ $item->views }}</span>
                                    </div>
                                    <p class="news-desc">{{$item->subtitle}}...</p>
                                    <div>
                                        <span class="news-tag">{{$categories[$item->cate_id]}}</span>
                                    </div>
                                </div>
                            </div>
                        </a>
                    </div>
                @endforeach
            </div>
        </div>

        <div class="tab-pane fade" id="guide" role="tabpanel">
            <div class="row">
                @foreach($collection->where('cate_id', 11) as $item)
                    <div class="col-md-6 col-lg-4">
                        <a href="https://erp.toysmodel.cn:11443/detail/{{$item->id}}">
                            <div class="news-card">
                                <img src="{{ $item->covers ?: $default }}" class="news-img" alt="图片">
                                <div class="news-body">
                                    <h5 class="news-title"><a href="https://erp.toysmodel.cn:11443/detail/{{$item->id}}">{{ $item->title }}</a></h5>
                                    <div class="news-meta">
                                        <span><i class="far fa-calendar-alt"></i>{{$item->datetime}}</span>
                                        <span><i class="far fa-eye"></i>{{ $item->views }}</span>
                                    </div>
                                    <p class="news-desc">{{$item->subtitle}}...</p>
                                    <div>
                                        <span class="news-tag">{{$categories[$item->cate_id]}}</span>
                                    </div>
                                </div>
                            </div>
                        </a>
                    </div>
                @endforeach
            </div>
        </div>
        <!-- 分页 -->
        {{--        <nav aria-label="Page navigation" class="mt-2">--}}
        {{--            <ul class="pagination justify-content-center">--}}
        {{--                <li class="page-item disabled">--}}
        {{--                    <a class="page-link" href="#" tabindex="-1">上一页</a>--}}
        {{--                </li>--}}
        {{--                <li class="page-item active"><a class="page-link" href="#">1</a></li>--}}
        {{--                <li class="page-item"><a class="page-link" href="#">2</a></li>--}}
        {{--                <li class="page-item"><a class="page-link" href="#">3</a></li>--}}
        {{--                <li class="page-item">--}}
        {{--                    <a class="page-link" href="#">下一页</a>--}}
        {{--                </li>--}}
        {{--            </ul>--}}
        {{--        </nav>--}}
    </div>
</main>

<!-- 页脚 -->
<footer class="footer">
    <div class="container">
        <div class="row">
            <div class="col-md-4">
                <h5 class="footer-title">联系我们</h5>
                <p><i class="fas fa-user me-2"></i>扬州市文化市场综合行政执法支队</p>
                <p><i class="fas fa-map-marker-alt me-2"></i>扬州市邗江区秋雨东路29号</p>
                <p><i class="fas fa-phone me-2"></i>0514-12345</p>
                <p><i class="fas fa-envelope me-2"></i>357743900@qq.com</p>
            </div>
        </div>
        <div class="copyright text-center">
            <p>© 2025 扬州市文化市场综合行政执法支队 版权所有 </p>
        </div>
    </div>
</footer>

<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.3/js/bootstrap.bundle.min.js"></script>
<script>
    // 标签切换效果
    let tabEls = document.querySelectorAll('button[data-bs-toggle="tab"]');
    tabEls.forEach(function(tabEl) {
        tabEl.addEventListener('shown.bs.tab', function (event) {
            event.target.classList.add('active');
            event.relatedTarget.classList.remove('active');
        });
    });
    // 禁止下载图片
    document.addEventListener('keydown', function(e) {
        // 禁用Print Screen键
        if (e.key === 'PrintScreen') {
            e.preventDefault();
            return false;
        }

        // 禁用Alt+Print Screen组合键
        if (e.altKey && e.key === 'PrintScreen') {
            e.preventDefault();
            return false;
        }
    });
</script>
</body>
</html>
